<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise.all 方法示例</title>
</head>
</body>
<script>
    let promise1 = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve(1000)
        }, 1000)
    })

    let promise2 = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve('hello')
        }, 1000)
    })
6
    let promise3 = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve('promise3失败')
        }, 1000)
    })

    let promise4 = Promise.all([promise1, promise2, promise3])
       .then((res) => {
            console.log(res);
        })
       .catch((err) => {
            console.log(err)
        })
</script>
</html>